package turring;

public class Transition {
	Etat next;
	char nouvelleLettre,ancienneLettre;
	int direction;
	
	Transition(char oldLetter, char newLetter,Etat state,int direction){
		next=state;
		nouvelleLettre=newLetter;
		ancienneLettre=oldLetter;
		this.direction=direction;
	}
	
	public boolean transitionPossible(char lettreCible)
	{
		return lettreCible==ancienneLettre;
	}
	
	public MachineTurring affectMachine(MachineTurring b)
	{
		MachineTurring nouvelle=b.clone();
		nouvelle.maBande[b.Tete]=nouvelleLettre;
		nouvelle.monEtat=next;
		nouvelle.Tete+=direction;
		
		return nouvelle;
	}
}
